<template>
	<view class="layout">
		<view class="navbar">
			<view class="statusBar" :style="{height:getStatusBarHeight()+'px'}"></view>
			<view class="titleBar" :style="{height:getTitleBarHeight()+'px'}">
				<view class=" title">{{title}}</view>
				<view class="search">
					<view class="icon">
						<uni-icons type="search" size="18" color="#888"></uni-icons>
					</view>
					<text class="text">搜索</text>
				</view>
			</view>
		</view>
		<view class="fill" :style="{height:getNavBarHeight()+'px'}"></view>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue';
	import {
		getStatusBarHeight,
		getTitleBarHeight,
		getNavBarHeight
	} from '@/utils/system.js';
	defineProps({
		title: {
			type: String,
			default: "壁纸"
		}
	})
</script>

<style lang="scss" scoped>
	.layout {
		.navbar {
			position: fixed;
			top: 0;
			lef: 0;
			width: 100%;
			z-index: 10;
			background:
				linear-gradient(to bottom, transparent 0%, #fff 360rpx),
				linear-gradient(to right, #C1EED9, #EFE2D9);

			.titleBar {
				display: flex;
				align-items: center;

				.title {
					font-size: 44rpx;
					font-weight: 700;
					color: $text-font-color-1;
					margin: 0 30rpx;
				}

				.search {
					width: 220rpx;
					height: 50rpx;
					background: rgba(255, 255, 255, 0.4);
					border: #fff solid 1rpx;
					border-radius: 50rpx;
					font-size: 28rpx;
					align-items: center;
					padding-left: 20rpx;
					display: flex;

					.text {
						padding-left: 10rpx;
						color: $text-font-color-2;
					}
				}
			}
		}
	}
</style>